<?php /* Smarty version Smarty-3.1.21-dev, created on 2018-03-07 17:37:19
         compiled from "/data/wwwroot/61kq.com/uploads/app/template/member/com/map.htm" */ ?>
<?php /*%%SmartyHeaderCode:5520483385a9fb2cf25e285-57078962%%*/if(!defined('SMARTY_DIR')) exit('no direct access allowed');
$_valid = $_smarty_tpl->decodeProperties(array (
  'file_dependency' => 
  array (
    '5db55c191d4e74b2fe4fe85b18d8f71bc1956653' => 
    array (
      0 => '/data/wwwroot/61kq.com/uploads/app/template/member/com/map.htm',
      1 => 1519634688,
      2 => 'file',
    ),
  ),
  'nocache_hash' => '5520483385a9fb2cf25e285-57078962',
  'function' => 
  array (
  ),
  'variables' => 
  array (
    'config_wapdomain' => 0,
    'row' => 0,
    'config' => 0,
    'city_name' => 0,
  ),
  'has_nocache_code' => false,
  'version' => 'Smarty-3.1.21-dev',
  'unifunc' => 'content_5a9fb2cf2e8ec5_58838317',
),false); /*/%%SmartyHeaderCode%%*/?>
<?php if ($_valid && !is_callable('content_5a9fb2cf2e8ec5_58838317')) {function content_5a9fb2cf2e8ec5_58838317($_smarty_tpl) {?><?php echo $_smarty_tpl->getSubTemplate (((string)$_smarty_tpl->tpl_vars['wapstyle']->value)."/member/cheader.htm", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array(), 0);?>

<?php echo '<script'; ?>
 type="text/javascript">
var weburl='<?php echo $_smarty_tpl->tpl_vars['config_wapdomain']->value;?>
'; 

<?php echo '</script'; ?>
>
<section class="wap_member">
  <div class="wap_member_comp_h1" style="position:relative"><span>企业地图</span></div>
  
  <div class="yun_wap_addresume_box">
    <form action="" method="post">
        <div class="yun_wap_mapset">
        <div class=""> 详细地址 <span class="resume-cont_wate_bj">*</span> <span class="yun_wap_mapset_ts">( 输入地址点击搜索即可获得相应位置 )</span></div>
       
      </div> <div class="yun_wap_mapsetadd">
            <input type="text" name="address" id='address' value="<?php echo $_smarty_tpl->tpl_vars['row']->value['address'];?>
"  placeholder="请填写详细地址" class="yun_wap_mapset_text">
            <input type="button" value="搜索" onclick="localsearch('全国');" class="yun_wap_mapsetadd_bth">
        </div>
       <div class="yun_wap_mapset">
        <div class=""> 设置地图 <span class="resume-cont_wate_bj">*</span> <span class="yun_wap_mapset_ts">( 在地图上点击所在位置即可 )</span></div>
        <div class="yun_wap_mapset_mapbox">
          <div id="map_container" style="width:100%;height:200px; left:0;"></div>
          <div class="yun_wap_mapset_mapbox_wz">
          x轴：<input name="xvalue" id="map_x" type="text" value="<?php echo $_smarty_tpl->tpl_vars['row']->value['x'];?>
" readonly="readonly"class="yun_wap_mapset_text">
          </div>
          <div class="yun_wap_mapset_mapbox_wz">
          y轴：<input name="yvalue" id="map_y" type="text" value="<?php echo $_smarty_tpl->tpl_vars['row']->value['y'];?>
" readonly="readonly"class="yun_wap_mapset_text">
          </div>
        </div>
      </div>
		<div class="yun_wap_mapset_mapbox_bth" style="background: transparent; border: none;">
        <input type="submit" name="submit" value="提交操作" class="reinputText2">
		</div>
   
      </form>
    </div> 
</section>
</div>

<?php echo '<script'; ?>
 type="text/javascript" src="<?php echo $_smarty_tpl->tpl_vars['config']->value['mapurl'];?>
"><?php echo '</script'; ?>
> 
<?php echo '<script'; ?>
 type="text/javascript" src="<?php echo $_smarty_tpl->tpl_vars['config']->value['sy_weburl'];?>
/js/map.js?v=<?php echo $_smarty_tpl->tpl_vars['config']->value['cachecode'];?>
"><?php echo '</script'; ?>
>
<?php echo '<script'; ?>
>
	var map=new BMap.Map("map_container");
	setLocation('map_container',116.404, 39.915,"map_x","map_y");
	$(document).ready(function() {
		<?php if (($_smarty_tpl->tpl_vars['row']->value['x']==''||$_smarty_tpl->tpl_vars['row']->value['y']=='')&&$_smarty_tpl->tpl_vars['row']->value['address']!='') {?>
			localsearch();
		<?php } elseif ($_smarty_tpl->tpl_vars['row']->value['x']!=''&&$_smarty_tpl->tpl_vars['row']->value['y']!='') {?>
			setLocation('map_container',<?php echo $_smarty_tpl->tpl_vars['row']->value['x'];?>
,<?php echo $_smarty_tpl->tpl_vars['row']->value['y'];?>
,"map_x","map_y");
		<?php } else { ?>
			var geolocation = new BMap.Geolocation();
			geolocation.getCurrentPosition(function (r) {
			
	        if (this.getStatus() == BMAP_STATUS_SUCCESS) {
	            location_r = r;
				setLocation('map_container',r.point.lng,r.point.lat,"map_x","map_y"); 
	        }
	    }, { enableHighAccuracy: true });
		<?php }?>
	});

	function localsearch(){
		if($("#address").val()==""){
			layer.msg('请输入地址！', 2, 8);return false;
		}
		// 创建地址解析器实例
		var myGeo = new BMap.Geocoder();
		// 将地址解析结果显示在地图上,并调整地图视野
		myGeo.getPoint('<?php echo $_smarty_tpl->tpl_vars['city_name']->value[$_smarty_tpl->tpl_vars['row']->value['provinceid']];
echo $_smarty_tpl->tpl_vars['city_name']->value[$_smarty_tpl->tpl_vars['row']->value['cityid']];
echo $_smarty_tpl->tpl_vars['city_name']->value[$_smarty_tpl->tpl_vars['row']->value['three_cityid']];?>
'+$("#address").val().replace(/\s+/g,""), function(point){
			if(point){
				$("#map_x").val(point.lng);
				$("#map_y").val(point.lat);
				map.centerAndZoom(point, 16);
				map.addOverlay(new BMap.Marker(point));
			}
		}, "北京市");
	}
	function setLocation(id,x,y,xid,yid){
		
		var rating,map_control_type,map_control_anchor;
		if(!x && !y){x='116.404';y='39.915';}
		var point = new BMap.Point(x,y);
		var marker = new BMap.Marker(point);
		var opts = {type:BMAP_NAVIGATION_CONTROL_LARGE}
		map.enableScrollWheelZoom(true);
		map.addControl(new BMap.NavigationControl(opts));
		map.centerAndZoom(point, 15);
		map.addOverlay(marker);
		map.addEventListener("click",function(e){
		   var info = new BMap.InfoWindow('', {width: 260});
			var projection = this.getMapType().getProjection();
			var lngLat = e.point;
			document.getElementById(xid).value=lngLat.lng;
			document.getElementById(yid).value=lngLat.lat;
			map.clearOverlays();
			var point = new BMap.Point(lngLat.lng,lngLat.lat);
			var marker = new BMap.Marker(point);
			map.addOverlay(marker);
		});
	}  
	
<?php echo '</script'; ?>
>
<?php echo $_smarty_tpl->getSubTemplate (((string)$_smarty_tpl->tpl_vars['wapstyle']->value)."/footer.htm", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array(), 0);?>
 <?php }} ?>
